package com.hoki.zj.hrm.domain;

import com.baomidou.mybatisplus.enums.IdType;
import java.math.BigDecimal;
import java.util.Date;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import java.io.Serializable;

/**
 * <p>
 * 
 * </p>
 *
 * @author shukei
 * @since 2021-09-29
 */
@EqualsAndHashCode(callSuper = true)
@TableName("t_pay_flow")
@Data
@AllArgsConstructor
@NoArgsConstructor
public class PayFlow extends Model<PayFlow> {

    private static final long serialVersionUID = 1L;

    public static final Integer PAY_TYPE_ALI_PAY = 1;
    public static final Integer PAY_TYPE_WX_PAY = 2;

//    0.支付中，1.支付成功，3.支付失败
    public static final Integer PAY_STATUS_PAYING = 0;
    public static final Integer PAY_STATUS_SUCCESS = 1;
    public static final Integer PAY_STATUS_FAILURE = 2;

    @TableId(value = "id", type = IdType.AUTO)
    private Long id;
    /**
     * 流水创建
     */
    @TableField("create_time")
    private Date createTime;
    /**
     * 发生金额
     */
    private BigDecimal amount;
    /**
     * 支付方式:0余额直接，1支付宝，2微信,3京东支付，4蚂蚁花呗
     */
    @TableField("pay_type")
    private Integer payType;
    /**
     * 业务ID，可以关联订单ID
     */
    @TableField("relation_id")
    private Long relationId;
    /**
     * 支付编号，可以用作订单编号
     */
    @TableField("pay_no")
    private String payNo;
    /**
     * 0.支付中，1.支付成功，3.支付失败
     */
    @TableField("pay_status")
    private Integer payStatus;
    /**
     * 0:下单支付，1充值支付
     */
    @TableField("business_type")
    private Integer businessType;
    /**
     * 支付描述
     */
    private String intro;
    /**
     * 支付结果描述，错误原因
     */
    @TableField("result_desc")
    private String resultDesc;
    private Integer version;

    @TableField("order_no")
    private String orderNo;

    @Override
    protected Serializable pkVal() {
        return this.id;
    }

}
